<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>充提记录</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	</head>
	<link rel="stylesheet" href="/zc/css/style.css" />
	<link rel="stylesheet" href="/zc/css/index.css" />
	<link rel="stylesheet" href="/zc/css/login.css" />
	<link rel="stylesheet" href="/zc/css/center_wddd.css" />
	<link href="/zc/css/footer.css" rel="stylesheet">
	<script src="/zc/js/flexible.js"></script>
	<script src="/zc/js/flexible_css.js"></script>
	<script src="/zc/js/template.js"></script>
	<script src="/zc/js/jquery.min.js"></script>
	<script src="/zc/js/unslider.min.js"></script>
	<script src="/zc/js/foot_bar.js"></script>
	<style>
	.act span{color:#18C78D;}
	.list_box{width:100%;height:auto;}
	.tab_title{width:100%;height:1.1rem;font-size:0.48rem;color:#666;line-height:1.1rem;}
	.tab_title span:first-child{width:38%;display:inline-block;text-align:center;}
	.tab_title span{width:29%;display:inline-block;text-align:center;}
	.list{background:#eee;}
	.list li{line-height:1.1rem;width:100%;height:1.1rem;color:#333;font-size:0.32rem;border-bottom:0.5px solid #ddd;}
	.list li span:first-child{width:38%;display:inline-block;text-align:center;}
	.list li span{width:30%;display:inline-block;text-align:center;}
	html{background:#eee;}
	</style>
	
	<body>
		<div class="header">
			<span>充提记录</span>
			<a href="javascript:history.go(-1)" class="return"></a>
		</div>
		<div style="height: 1rem;"></div>
		
		<!--选项卡-->
		<nav id="nav">
			<ul>
				<li class="act" data="1" style="border-right: 1px solid #e4e4e4;width: 50%;"><span class="mxb">充值记录</span></li>
				<li style="width: 49%;" data = "2"><span>提币记录</span></li>
			</ul>
		</nav>
		
		<div class="kh"></div>
		<!--内容部分HTML代码-->
		<div id="container">
			<!--充值记录开始-->
			<section class="tab" style="display:none;">
				<div class="zwsj">
					<img src="/zc/img/center14.png">
					<p>暂无数据</p>
					<button type="submit">点击刷新</button>
				</div>	
			</section>
			<!--充值记录结束-->
		</div>
		<div class="list_box">
			<div class="tab_title">
				<span>时间</span>
				<span class="numtit">提币金额</span>
				<span>状态</span>
			</div>
			<ul class="list">
				<!--<li>
					<span>时间</span>
					<span>提币金额</span>
					<span>状态</span>
				</li>-->
			</ul>
		</div>
		<!-- 结束 -->
	</body>
	
	<!--选项卡-->
	<script>
	log_list(1);
	 window.onload=function () {
	 	var nav=document.getElementById('nav');
	 	var oNav=nav.getElementsByTagName('li');
	 
	 	var container=document.getElementById('container');
	 	//var oDiv=container.getElementsByClassName('tab');
	 		for(var i=0;i<oNav.length;i++){
	  			oNav[i].index=i;
	  			oNav[i].onclick=function () {
	  		for(var i=0;i<oNav.length;i++){
	   			oNav[i].className='';
	   			//oDiv[i].style.display="none";
	  			}
	  		this.className='act';
	  			//oDiv[this.index].style.display="block"
				log_list(1);
	  			}
	  		for(var m=1;m<oNav.length;m++){
			   	oNav[m].className='';
			   	//oDiv[m].style.display="none";
	  		}
	 	}
	 };
	 var page = 1;
	 var count = '';
	 var num = 0;
	function log_list(stat){
		var type = $('.act').attr('data');
		$.ajax({
			type: "POST",
			url: "/index/asset/tblog",
			dataType: "json",
			data:{type:type,page:page,limit:15},
			success: function (res) {
			console.log(res);
				if(res.code==0){
					count = res.count;
					//page++;
					//console.log(page);
					num = parseInt(res.info.length)*1+num*1;
					if(count > num){
						page++;
					}
					if(type == 1){
						$('.tab_title .numtit').text('充值金额');
					}else{
						$('.tab_title .numtit').text('提币金额');
					}
					var str = '';
					for(var i=0;i<res.info.length;i++){
						str += '<li>';
						str += '<span>'+res.info[i].createtime+'</span>';
						str += '<span>'+res.info[i].number+'</span>';
						if(res.info[i].status == 1){
							str += '<span>待审核</span>';
						}else if(res.info[i].status == 2){
							str += '<span>成功</span>';
						}else if(res.info[i].status == 3){
							str += '<span>失敗</span>';
						}
						str += '</li>';
					}
					if(stat == 1){
						$('.list').html(str);
					}else{
						$('.list').append(str);
					}
				}else{
					mui.toast(res.message);
					$('.tab').show();
				}
			}
		});
	}
	
	 // 下拉加载
	 $(window).off("scroll").on("scroll", function(e){
			var totalheight = parseFloat($('.list_box').height()) + parseFloat($(document).scrollTop());
			if (($(document).height()<=totalheight)){
				if(count > num){
					log_list(2);
				}
			}
		});  
	
	</script>
	
</html>
